package com.ruoyi.LXHComplaint.controller;


import com.ruoyi.LXHComplaint.service.ILXHSysUserService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
//@Api(tags = "医生选择接口") // 统一接口分组
@RestController // 替代 @Controller + @ResponseBody
@RequestMapping("/LXHComplaint/doctor") // 增加模块路径前缀，避免URL冲突
public class DoctorSelectController extends BaseController { // 继承框架基础控制器

    @Autowired
    private ILXHSysUserService lxhSysUserService;

    /**
     * 根据当前登录用户ID查询所属团队医生
     * 无需传入userId，自动从上下文获取
     */
//    @ApiOperation("查询当前用户所属团队医生")
    @GetMapping("/selectCurrentTeam")
    public AjaxResult selectCurrentTeamDoctors() {
        // 从安全上下文获取当前登录用户ID（符合框架规范）
        Long currentUserId = getUserId();
        List<Map<String, Object>> doctors = lxhSysUserService.selectTeamDoctorsByUserId(currentUserId);
        return AjaxResult.success(doctors);
    }
}